﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace HigLabo.Net.Twitter
{
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void GetBlocksList(GetBlocksListCommand command, Action<FriendsUser> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Blocks.GetBlocksListUrl, command
                , json => callback(new FriendsUser(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void GetBlocksIds(GetBlocksIdsCommand command, Action<Friends> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Blocks.GetBlocksIdsUrl, command
                , json => callback(new Friends(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="callback"></param>
        public void CreateBlocks(Int64 userID, Action<User> callback)
        {
            this.CreateBlocks(new CreateBlocksCommand() { UserID = userID }, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="screenName"></param>
        /// <param name="callback"></param>
        public void CreateBlocks(String screenName, Action<User> callback)
        {
            this.CreateBlocks(new CreateBlocksCommand() { ScreenName = screenName }, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void CreateBlocks(CreateBlocksCommand command, Action<User> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Blocks.CreateBlocksUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="callback"></param>
        public void DestroyBlocks(Int64 userID, Action<User> callback)
        {
            this.DestroyBlocks(new DestroyBlocksCommand() { UserID = userID }, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="screenName"></param>
        /// <param name="callback"></param>
        public void DestroyBlocks(String screenName, Action<User> callback)
        {
            DestroyBlocks(new DestroyBlocksCommand() { ScreenName = screenName }, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void DestroyBlocks(DestroyBlocksCommand command, Action<User> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Blocks.DestroyBlocksUrl, command
                , json => callback(new User(json)));
        }
    }
}
